import request from '@/utils/request'

/**
 * 去结算
 * @param mode
 * @param obj
 * @returns {Promise<axios.AxiosResponse<any>>}
 */
export const checkOutOrder = (mode, obj) => {
  return request.get('/checkout/order', {
    params: {
      mode,
      ...obj
    }
  })
}

// 提交订单
export const submitOrder = (mode, params) => {
  return request.post('/checkout/submit', {
    mode,
    payType: 10,
    delivery: 10,
    couponId: 0,
    isUsePoints: 0,
    ...params

  })
}

// 我的订单
export const getMyOrder = (dataType, page) => {
  return request.get('/order/list', {
    params: {
      dataType,
      page
    }
  }
  )
}
